<template>
  <div class="fishbone-wrapper">
    <div class="content-wrapper">
      <div class="fishbone-container">
        <div class="fishbone">
          <!-- 鱼尾 -->
          <div class="fish-head">
            <img src="../../public/鱼尾.png" alt="鱼尾" class="head-image">
          </div>

          <!-- 主骨和节点 -->
          <div class="main-bone">
            <!-- 基本信息节点 - 向上展开 -->
            <div class="main-node identity-node expand-up" :class="{ 'active': isIdentityOpen }">
              <div class="node-circle">
                <span>基本<br>信息</span>
                <i class="fas" :class="isIdentityOpen ? 'fa-chevron-down' : 'fa-chevron-up'"></i>
              </div>
              <div class="branches centered" v-if="isIdentityOpen">
                <div
                    class="branch-box"
                    v-for="item in identityLeftUp"
                    :key="item.id"
                    :class="{
                      disabled: item.disabled || (item.id === 'shareholder' && !hasShareholdersInfo) ||
                               (item.id === 'business' && !hasBusinessInfo)
                    }"
                    @click="!item.disabled && handleBasicInfoClick(item.id)"
                >
                  <div class="box-title">{{ item.title }}</div>
                </div>
              </div>
            </div>

            <!-- 基本信息节点 - 向下展开 -->
            <div class="main-node identity-node expand-down" :class="{ 'active': isIdentityOpen }">
              <div class="node-circle">
                <span>基本<br>信息</span>
                <i class="fas" :class="isIdentityOpen ? 'fa-chevron-down' : 'fa-chevron-up'"></i>
              </div>
              <div class="branches centered" v-if="isIdentityOpen">
                <div
                    class="branch-box"
                    v-for="item in identityLeft"
                    :key="item.id"
                    :class="{ disabled: item.disabled }"
                    @click="!item.disabled && handleBasicInfoClick(item.id)"
                >
                  <div class="box-title">{{ item.title }}</div>
                </div>
              </div>
            </div>

            <!-- 财产信息节点 - 向上展开 -->
            <div class="main-node property-node expand-up" :class="{ 'active': isPropertyOpen }">
              <div class="node-circle">
                <span>财产<br>信息</span>
                <i class="fas" :class="isPropertyOpen ? 'fa-chevron-up' : 'fa-chevron-down'"></i>
              </div>
              <div class="branches centered" v-if="isPropertyOpen">
                <div
                    class="branch-box"
                    v-for="item in propertyRightUp"
                    :key="item.id"
                    :class="{ disabled: item.disabled }"
                    @click="!item.disabled && showPropertyDialog(item.id)"
                >
                  <div class="box-title">{{ item.title }}</div>
                </div>
              </div>
            </div>
            <!-- 财产信息节点 - 向下展开 -->
            <div class="main-node property-node expand-down" :class="{ 'active': isPropertyOpen }">
              <div class="node-circle">
                <span>财产<br>信息</span>
                <i class="fas" :class="isPropertyOpen ? 'fa-chevron-up' : 'fa-chevron-down'"></i>
              </div>
              <div class="branches centered" v-if="isPropertyOpen">
                <div
                    class="branch-box"
                    v-for="item in propertyRightDown"
                    :key="item.id"
                    :class="{ disabled: item.disabled }"
                    @click="!item.disabled && showPropertyDialog(item.id)"
                >
                  <div class="box-title">{{ item.title }}</div>
                </div>
              </div>
            </div>

            <!-- 税务信息节点 - 向上展开 -->
            <div class="main-node consumption-node expand-up" :class="{ 'active': isConsumptionOpen }">
              <div class="node-circle">
                <span>风险<br>信息</span>
                <i class="fas" :class="isConsumptionOpen ? 'fa-chevron-down' : 'fa-chevron-up'"></i>
              </div>
              <div class="branches centered" v-if="isConsumptionOpen">
                <div
                    class="branch-box"
                    v-for="item in consumptionLeftUp"
                    :key="item.id"
                    :class="{ disabled: true }"
                    @click="!item.disabled && showTaxDialog(item.id)"
                >
                  <div class="box-title">{{ item.title }}</div>
                </div>
              </div>
            </div>

            <!-- 税务信息节点 - 向下展开 -->
            <div class="main-node consumption-node expand-down" :class="{ 'active': isConsumptionOpen }">
              <div class="node-circle">
                <span>风险<br>信息</span>
                <i class="fas" :class="isConsumptionOpen ? 'fa-chevron-down' : 'fa-chevron-up'"></i>
              </div>
              <div class="branches centered" v-if="isConsumptionOpen">
                <div
                    class="branch-box"
                    v-for="item in consumptionLeft"
                    :key="item.id"
                    :class="{ disabled: item.disabled }"
                    @click="!item.disabled && showTaxDialog(item.id)"
                >
                  <div class="box-title">{{ item.title }}</div>
                </div>
              </div>
            </div>

            <!-- 信用信息节点 - 向上展开 -->
            <div class="main-node action-node expand-up" :class="{ 'active': isActionOpen }">
              <div class="node-circle">
                <span>司法<br>信息</span>
                <i class="fas" :class="isActionOpen ? 'fa-chevron-up' : 'fa-chevron-down'"></i>
              </div>
              <div class="branches centered" v-if="isActionOpen">
                <div
                    class="branch-box"
                    v-for="item in actionRight"
                    :key="item.id"
                    :class="{ disabled: item.id === 'dishonesty' || item.content === '暂无'}"
                    @click="showDetail(item.id, 'credit')"
                >
                  <div class="box-title">{{ item.title }}</div>
                </div>
              </div>
            </div>

            <!-- 关联信息节点 - 向下展开 -->
            <div class="main-node relation-node expand-down" :class="{ 'active': isRelationOpen }">
              <div class="node-circle">
                <span>关联<br>信息</span>
                <i class="fas" :class="isRelationOpen ? 'fa-chevron-down' : 'fa-chevron-up'"></i>
              </div>
              <div class="branches centered" v-if="isRelationOpen">
                <div
                    class="branch-box"
                    v-for="item in relationLeft"
                    :key="item.id"
                    :class="{ disabled: item.disabled }"
                    @click="!item.disabled && showRelationDialog(item.id)"
                >
                  <div class="box-title">{{ item.title }}</div>
                </div>
              </div>
            </div>
          </div>

          <!-- 鱼头 -->
          <div class="fish-tail">
            <img src="../../public/鱼头.png" alt="鱼头" class="tail-image">
          </div>
        </div>
      </div>
    </div>

    <!-- 通用弹窗组件 -->
    <el-dialog v-model="dialogVisible" :title="dialogTitle" width="80%">
      <div class="dialog-content">
        <el-table
          :data="dialogTableData"
          border
          stripe
          style="width: 100%"
          :empty-text="dialogEmptyText"
        >
          <!-- 基本信息表格列 -->
          <template v-if="dialogType === 'base'">
            <el-table-column prop="apprdate" label="核准日期" align="center"></el-table-column>
            <el-table-column prop="dom" label="住所" align="center"></el-table-column>
            <el-table-column prop="entname" label="企业名称" align="center"></el-table-column>
            <el-table-column prop="enttypeCn" label="企业类型" align="center"></el-table-column>
            <el-table-column prop="estdate" label="成立日期" align="center"></el-table-column>
            <el-table-column prop="name" label="法定代表人" align="center"></el-table-column>
            <el-table-column prop="opfrom" label="经营期限自" align="center"></el-table-column>
            <el-table-column prop="opscope" label="经营范围" align="center"></el-table-column>
            <el-table-column prop="opto" label="经营期限至" align="center"></el-table-column>
            <el-table-column prop="regcap" label="注册资本" align="center"></el-table-column>
            <el-table-column prop="regno" label="注册号" align="center"></el-table-column>
            <el-table-column prop="regcapcurCn" label="注册资本币种" align="center"></el-table-column>
            <el-table-column prop="regorgCn" label="登记机关" align="center"></el-table-column>
            <el-table-column prop="regstateCn" label="登记状态" align="center"></el-table-column>
            <el-table-column prop="sExtNodenum" label="节点号" align="center"></el-table-column>
            <el-table-column prop="uniscid" label="统一社会信用代码" align="center"></el-table-column>

          </template>

          <!-- 股东信息表格列 -->
          <template v-if="dialogType === 'shareholder'">
            <el-table-column prop="xm" label="股东名称" align="center"></el-table-column>
            <el-table-column prop="zs" label="企业地址" align="center"></el-table-column>
            <el-table-column prop="zczb" label="注册资本" align="center"></el-table-column>
            <el-table-column prop="zd" label="统一社会信用代码" align="center"></el-table-column>
            <el-table-column prop="rje" label="股东认缴" align="center"></el-table-column>
            <el-table-column prop="hzrq" label="核准日期" align="center"></el-table-column>
            <el-table-column prop="jjhklb" label="经济户口类别" align="center"></el-table-column>
            <el-table-column prop="qylx" label="企业类型" align="center"></el-table-column>
            <el-table-column prop="qymc" label="企业名称" align="center"></el-table-column>
            <el-table-column prop="rmlx" label="人员类型" align="center"></el-table-column>

          </template>

          <!-- 工商信息表格列 -->
          <template v-if="dialogType === 'business'">
            <el-table-column prop="enterpriseName" label="企业名称" align="center"></el-table-column>
            <el-table-column prop="unifiedSocialCreditCode" label="统一社会信用代码" align="center"></el-table-column>
            <el-table-column prop="legalRepresentative" label="法定代表人" align="center"></el-table-column>
            <el-table-column prop="enterpriseType" label="企业类型" align="center"></el-table-column>
            <el-table-column prop="establishmentDate" label="成立日期" align="center"></el-table-column>
            <el-table-column prop="registeredCapital" label="注册资本" align="center"></el-table-column>
            <el-table-column prop="approvalDate" label="核准日期" align="center"></el-table-column>
            <el-table-column prop="operatingPeriod" label="经营期限" align="center"></el-table-column>
            <el-table-column prop="registrationAuthority" label="登记机关" align="center"></el-table-column>
            <el-table-column prop="registrationStatus" label="登记状态" align="center"></el-table-column>
            <el-table-column prop="domicile" label="住所" align="center"></el-table-column>
            <el-table-column prop="businessScope" label="经营范围" align="center"></el-table-column>
            <el-table-column prop="industry" label="所属行业" align="center"></el-table-column>
          </template>
          <!-- 行政评定表格列 -->
          <template v-if="dialogType === 'evaluation'">
            <el-table-column prop="xmmc" label="项目名称" align="center"></el-table-column>
            <el-table-column prop="wcdw" label="完成单位" align="center"></el-table-column>
            <el-table-column prop="wcry" label="完成人员" align="center"></el-table-column>
            <el-table-column prop="shjz" label="所获奖种" align="center"></el-table-column>
            <el-table-column prop="hjdj" label="获奖等级" align="center"></el-table-column>
            <el-table-column prop="dy" label="地域" align="center"></el-table-column>
            <el-table-column prop="hjnf" label="获奖年份" align="center"></el-table-column>
          </template>
          <!--    单位参保基本信息表格      -->
          <template v-if="dialogType === 'insuranceUnit'">
            <el-table-column prop="empNo" label="单位编号" align="center"></el-table-column>
            <el-table-column prop="empEnttCodg" label="单位实体编码" align="center"></el-table-column>
            <el-table-column prop="empMgtType" label="单位管理类型" align="center"></el-table-column>
            <el-table-column prop="prntEmpNo" label="上级单位编号" align="center"></el-table-column>
            <el-table-column prop="asocLegentFlag" label="关联法人标志" align="center"></el-table-column>
            <el-table-column prop="empType" label="单位类型" align="center"></el-table-column>
            <el-table-column prop="empName" label="单位名称" align="center"></el-table-column>
            <el-table-column prop="regName" label="注册名称" align="center"></el-table-column>
            <el-table-column prop="locAdmdvs" label="所属医保区划" align="center"></el-table-column>
            <el-table-column prop="conerName" label="联系人姓名" align="center"></el-table-column>
            <el-table-column prop="conerEmail" label="联系人电子邮箱" align="center"></el-table-column>
            <el-table-column prop="tel" label="联系电话" align="center"></el-table-column>
            <el-table-column prop="faxNo" label="传真号码" align="center"></el-table-column>
            <el-table-column prop="taxRegNo" label="税务登记号" align="center"></el-table-column>
            <el-table-column prop="orgcode" label="组织机构代码" align="center"></el-table-column>
            <el-table-column prop="regno" label="注册号" align="center"></el-table-column>
            <el-table-column prop="regnoCertType" label="注册号证件类型" align="center"></el-table-column>
            <el-table-column prop="empAddr" label="单位地址" align="center"></el-table-column>
            <el-table-column prop="poscode" label="邮政编码" align="center"></el-table-column>
            <el-table-column prop="aprvEstaDept" label="批准成立部门" align="center"></el-table-column>
            <el-table-column prop="aprvEstaDate" label="批准成立日期" align="center"></el-table-column>
            <el-table-column prop="aprvEstaDocno" label="批准成立文号" align="center"></el-table-column>
            <el-table-column prop="prntAdmdvs" label="上级医保区划" align="center"></el-table-column>
            <el-table-column prop="insuAdmdvs" label="参保所属医保区划" align="center"></el-table-column>
            <el-table-column prop="orgValiStas" label="组织有效状态" align="center"></el-table-column>
            <el-table-column prop="legrepTel" label="法定代表人电话号码" align="center"></el-table-column>
            <el-table-column prop="legrepName" label="法定代表人姓名" align="center"></el-table-column>
            <el-table-column prop="legrepCertType" label="法定代表人证件类型" align="center"></el-table-column>
            <el-table-column prop="legrepCertno" label="法定代表人证件号码" align="center"></el-table-column>
            <el-table-column prop="orgcodeIssuEmp" label="组织机构代码证颁发单位" align="center"></el-table-column>
            <el-table-column prop="valiFlag" label="有效标志" align="center"></el-table-column>
            <el-table-column prop="rid" label="数据唯一记录号" align="center"></el-table-column>
            <el-table-column prop="crteTime" label="创建时间" align="center"></el-table-column>
            <el-table-column prop="updtTime" label="更新时间" align="center"></el-table-column>
            <el-table-column prop="crterId" label="创建人ID" align="center"></el-table-column>
            <el-table-column prop="crterName" label="创建人姓名" align="center"></el-table-column>
            <el-table-column prop="crteOptinsNo" label="创建机构名称" align="center"></el-table-column>
            <el-table-column prop="opterId" label="经办人ID" align="center"></el-table-column>
            <el-table-column prop="opterName" label="经办姓名" align="center"></el-table-column>
            <el-table-column prop="optTime" label="经办时间" align="center"></el-table-column>
            <el-table-column prop="optinsNo" label="经办机构编号" align="center"></el-table-column>
            <el-table-column prop="poolareaNo" label="统筹区编号" align="center"></el-table-column>
            <el-table-column prop="ver" label="版本号" align="center"></el-table-column>
            <el-table-column prop="syncPrntFlag" label="同步上级标志" align="center"></el-table-column>
            <el-table-column prop="entpSpecFlag" label="企业规格标志" align="center"></el-table-column>
            <el-table-column prop="dsgId" label="DSG_ID" align="center"></el-table-column>
            <el-table-column prop="memo" label="备注" align="center"></el-table-column>
            <el-table-column prop="leafounUpdateTime" label="更新时间" align="center"></el-table-column>

          </template>

          <!-- 年报信息表格列 -->
          <template v-if="dialogType === 'annualReport'">
            <el-table-column prop="qymc" label="企业名称" align="center"></el-table-column>
            <el-table-column prop="jyzt" label="经营状态" align="center"></el-table-column>
            <el-table-column prop="year" label="年份" align="center"></el-table-column>
            <el-table-column prop="clrq" label="成立日期" align="center"></el-table-column>
            <el-table-column prop="anchedate" label="上报日期" align="center"></el-table-column>
<!--            <el-table-column prop="contactPhone" label="登记机关" align="center"></el-table-column>-->
            <el-table-column prop="jyfw" label="经营范围" align="center"></el-table-column>
            <el-table-column prop="qylx" label="企业类型" align="center"></el-table-column>

          </template>

          <!-- 银行卡信息表格列 -->
          <template v-if="dialogType === 'bankCard'">
            <el-table-column prop="caseNumber" label="案号" align="center"></el-table-column>
            <el-table-column prop="accountBank" label="开户银行" align="center"></el-table-column>
            <el-table-column prop="accountNumber" label="银行账号" align="center"></el-table-column>
            <el-table-column prop="accountBalance" label="账户余额" align="center"></el-table-column>
            <el-table-column prop="accountCategory" label="账户类型" align="center"></el-table-column>
            <el-table-column prop="contactPhone" label="联系电话" align="center"></el-table-column>
          </template>

          <!-- 车辆信息表格列 -->
          <template v-if="dialogType === 'vehicle'">
            <el-table-column prop="VEHICLENUM" label="车牌号" align="center"></el-table-column>
            <el-table-column prop="ANNULEXPIRYDATE" label="年审有效日期" align="center"></el-table-column>
            <el-table-column prop="BRAND" label="厂牌" align="center"></el-table-column>
            <el-table-column prop="CERTSTATE" label="证件状态" align="center"></el-table-column>
            <el-table-column prop="DRIVINGREGDATE" label="行驶证初领日期" align="center"></el-table-column>
            <el-table-column prop="INSPECTDATE" label="年审日期" align="center"></el-table-column>
            <el-table-column prop="ISSUEORGNAME" label="发证机构" align="center"></el-table-column>
            <el-table-column prop="LICENSEENDDATE" label="证件有效期止" align="center"></el-table-column>
            <el-table-column prop="LICENSEFIRSTDATE" label="证件初领日期" align="center"></el-table-column>
<!--            <el-table-column prop="vehicleStatus" label="联系手机" align="center"></el-table-column>-->
<!--            <el-table-column prop="vehicleStatus" label="停运结束时间" align="center"></el-table-column>-->
            <el-table-column prop="VEHICLEID" label="车辆Id" align="center"></el-table-column>
          </template>

          <!-- 船舶信息表格列 -->
          <template v-if="dialogType === 'ship'">
            <el-table-column prop="BEFORENAME" label="曾用名" align="center"></el-table-column>
            <el-table-column prop="BUILDDATE" label="建造日期" align="center"></el-table-column>
            <el-table-column prop="CAPTAINNAME" label="船长姓名" align="center"></el-table-column>
            <el-table-column prop="CERTSTATE" label="证件状态代码" align="center"></el-table-column>
            <el-table-column prop="ENTLICENSENO" label="船舶经营人许可证号" align="center"></el-table-column>
            <el-table-column prop="ENTRUSTMENTCONTRACTDATE" label="船舶适任证书期限" align="center"></el-table-column>
            <el-table-column prop="RUNNER" label="经营人" align="center"></el-table-column>
          </template>

          <!-- 企业所得税征收方式核定结果 -->
          <template v-if="dialogType === 'enterpriseIncomeTax'">
            <el-table-column prop="nsrsbh" label="纳税人识别号" align="center"></el-table-column>
            <el-table-column prop="nsrmc" label="纳税人名称" align="center"></el-table-column>
            <el-table-column prop="jyfw" label="经营范围" align="center"></el-table-column>
            <el-table-column prop="hymc" label="行业名称" align="center"></el-table-column>
            <el-table-column prop="nhdynssde" label="年核定应纳税所得额" align="center"></el-table-column>
            <el-table-column prop="yssdl" label="应税所得率" align="center"></el-table-column>
            <el-table-column prop="nd" label="年度" align="center"></el-table-column>
          </template>

          <!-- 个体工商户定期定额信息表 -->
          <template v-if="dialogType === 'individualBussiness'">
            <el-table-column prop="nsrsbh" label="纳税人识别号" align="center"></el-table-column>
            <el-table-column prop="nsrmc" label="纳税人名称" align="center"></el-table-column>
            <el-table-column prop="scjydz" label="生产经营地址" align="center"></el-table-column>
            <el-table-column prop="hymc" label="行业名称" align="center"></el-table-column>
            <el-table-column prop="hdzxqq" label="核定期起" align="center"></el-table-column>
            <el-table-column prop="hdzxqz" label="核定期止" align="center"></el-table-column>
            <el-table-column prop="zsxmmc" label="征收项目名称" align="center"></el-table-column>
            <el-table-column prop="hdse" label="核定税额" align="center"></el-table-column>
            <el-table-column prop="sl1" label="税率" align="center"></el-table-column>
            <el-table-column prop="ynse" label="应纳税额" align="center"></el-table-column>
          </template>

          <!-- 纳税资质表格列 -->
          <template v-if="dialogType === 'tax-qualification'">
            <el-table-column prop="qualification" label="纳税资质类型" align="center"></el-table-column>
            <el-table-column prop="status" label="资质状态" align="center"></el-table-column>
            <el-table-column prop="issueDate" label="核发日期" align="center" :formatter="formatDate"></el-table-column>
          </template>

          <!-- 纳税信用表格列 -->
          <template v-if="dialogType === 'taxPayCredit'">
            <el-table-column prop="nsrsbh" label="纳税人识别号" align="center"></el-table-column>
            <el-table-column prop="nsrmc" label="纳税人名称" align="center"></el-table-column>
            <el-table-column prop="zzJb" label="信用等级" align="center" ></el-table-column>
            <el-table-column prop="nd" label="年度" align="center"></el-table-column>
          </template>

          <!-- 欠税公告表格列 -->
          <template v-if="dialogType === 'taxArrears'">
            <el-table-column prop="nsrsbh" label="纳税人识别号" align="center"></el-table-column>
            <el-table-column prop="zsxmmc" label="征收品目名称" align="center"></el-table-column>
            <el-table-column prop="ybtse" label="应补（退）税额" align="center" ></el-table-column>
            <el-table-column prop="nsrmc" label="纳税人名称" align="center"></el-table-column>
            <el-table-column prop="fddbrxm" label="法定代表人姓名" align="center"></el-table-column>
            <el-table-column prop="scjydz" label="生产经营地址" align="center"></el-table-column>
          </template>

          <!-- 委托代征纳税人表格列 -->
          <template v-if="dialogType === 'authorizedTax'">
            <el-table-column prop="swjgmc" label="税务机关名称" align="center"></el-table-column>
            <el-table-column prop="nsrmc" label="纳税人名称" align="center"></el-table-column>
            <el-table-column prop="fddbryddh" label="法人移动电话" align="center" ></el-table-column>
            <el-table-column prop="fddbrxm" label="法人姓名" align="center"></el-table-column>
            <el-table-column prop="scjydz" label="生产经营地址" align="center"></el-table-column>
            <el-table-column prop="dzfw" label="代征范围" align="center"></el-table-column>
            <el-table-column prop="dzqxq" label="代征期起" align="center"></el-table-column>
            <el-table-column prop="dzqxz" label="代征期止" align="center"></el-table-column>
            <el-table-column prop="zsxmjc" label="征收项目" align="center"></el-table-column>
            <el-table-column prop="jsyjjsl" label="计税依据及税率" align="center"></el-table-column>
          </template>

          <!--  纳税非正常户信息表格 -->
          <template v-if="dialogType === 'abnormalTaxPayer'">
            <el-table-column prop="nsrsbh" label="纳税人识别号" align="center"></el-table-column>
            <el-table-column prop="nsrmc" label="纳税人名称" align="center"></el-table-column>
            <el-table-column prop="fddbrxm" label="法定代表人姓名" align="center" ></el-table-column>
            <el-table-column prop="fddbrsfzjhm" label="法人证件号码" align="center"></el-table-column>
            <el-table-column prop="fddbrsfzjlxDm" label="证件类型" align="center"></el-table-column>
            <el-table-column prop="scjydz" label="生产经营地址" align="center"></el-table-column>
            <el-table-column prop="rdrq" label="认定日期" align="center"></el-table-column>
            <el-table-column prop="jcfzchrq" label="解除非正常户日期" align="center"></el-table-column>
          </template>

          <!-- 关联企业表格列 -->
          <template v-if="dialogType === 'related-enterprises'">
            <el-table-column prop="company_name" label="关联企业名称" align="center"></el-table-column>
            <el-table-column prop="company_id" label="企业ID" align="center"></el-table-column>
            <el-table-column prop="reason" label="关联原因" align="center"></el-table-column>
            <el-table-column prop="date" label="关联日期" align="center" :formatter="formatDate"></el-table-column>
          </template>

          <!-- 关联案件表格列 -->
          <template v-if="dialogType === 'related-cases'">
            <el-table-column prop="caseNumber" label="案号" align="center"></el-table-column>
            <el-table-column prop="parties" label="当事人" align="center"></el-table-column>
            <el-table-column prop="amount" label="金额（元）" align="center"></el-table-column>
            <el-table-column prop="closeMethod" label="结案方式" align="center"></el-table-column>
          </template>

          <!-- 公开专利信息表格列 -->
          <template v-if="dialogType === 'publicPatent'">
            <el-table-column prop="caseNumber" label="案号" align="center"></el-table-column>
            <el-table-column prop="patentName" label="专利名称" align="center"></el-table-column>
            <el-table-column prop="patentApplicationNumber" label="专利申请号" align="center"></el-table-column>
            <el-table-column prop="caseStatus" label="案件业务状态" align="center"></el-table-column>
            <el-table-column prop="address" label="地址" align="center"></el-table-column>
          </template>

          <!-- 房产信息表格列 -->
          <template v-if="dialogType === 'houseProperty'">
            <el-table-column prop="location" label="坐落" align="center"></el-table-column>
            <el-table-column prop="buildingArea" label="建筑面积" align="center"></el-table-column>
            <el-table-column prop="landUseArea" label="土地使用面积" align="center"></el-table-column>
            <el-table-column prop="landPurpose" label="宗地用途" align="center"></el-table-column>
            <el-table-column prop="mortgageInfo" label="抵押信息" align="center"></el-table-column>
            <el-table-column prop="mortgageAmount" label="抵押金额" align="center"></el-table-column>
            <el-table-column prop="isSeized" label="是否查封" align="center"></el-table-column>
          </template>

          <!-- 乡村建设规划许可证信息表格列 -->
          <template v-if="dialogType === 'contributionPermit'">
            <el-table-column prop="jsdw" label="建设单位" align="center"></el-table-column>
            <el-table-column prop="jsxmmc" label="建设项目名称" align="center"></el-table-column>
            <el-table-column prop="jswz" label="建设位置" align="center"></el-table-column>
            <el-table-column prop="fzrq" label="发证日期" align="center"></el-table-column>
            <el-table-column prop="jsfjft" label="证书附件附图" align="center"></el-table-column>
            <el-table-column prop="zsbh" label="证书编号" align="center"></el-table-column>
          </template>

        </el-table>

        <!-- 文本类内容展示（如执转破） -->
        <div v-if="dialogType === 'text'" class="text-content">
          {{ dialogTextContent }}
        </div>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="dialogVisible = false">关闭</el-button>
        </span>
      </template>
    </el-dialog>

  </div>
</template>

<script>
// 引入data.js中的企业数据和获取方法
import { companyData, getCompanyData } from '@/mock/data.js';
import axios from "axios";

export default {
  name: 'FishboneDiagram',
  props: {
    idNumber: String,
    name: String, // 接收父组件传递的企业名称
    isQuery: Boolean
  },
  data() {
    return {
      // 基本信息上
      BaseInfo: [], //企业基本信息
      marketInfo: [], // 市场主体基本信息
      socialInfo: [], // 社会组织信息
      shareHolderInfo: [], //股东信息
      directorInfo: [], //董事信息
      supervisorInfo: [], //监事信息
      // 基本信息下
      businessInfo: [], //工商信息
      licenseInfo: [], //营业执照信息
      electronicCertificateInfo:[], //电子证照信息
      administrativeAwardInfo: [], //行政奖励
      EvaluationInfo: [], // 行政评定
      socialSecurityInfo: [], //社保信息
      electricityInfo: [], //用电信息
      insuranceUnitInfo:[], //参保单位基本信息
      // 财产信息上
      publicPatentInfo: [], //公开专利信息
      trademarkInfo: [], //商标信息
      planningPermissionInfo: [], //规划许可
      administrativePermissionInfo: [], //形状许可
      // 财产信息下
      annualReportInfo: [], //年报信息
      bankCardInfo: [], //银行卡信息
      housePropertyInfo: [], //房产信息
      vehicleInfo: [], // 车辆信息
      shipInfo: [],
      otherPropertyInfo: [], //其他财产信息
      // 税务有关信息
      individualBussinessInfo: [], //个体工商户定额信息
      enterpriseIncomeTaxInfo: [], //企业所得税征收方式核定结果
      taxPayCreditInfo: [], //纳税信用信息
      taxArrearsInfo: [], //欠税公告信息
      authorizedTaxInfo: [], //委托代征纳税人信息
      abnormalTaxPayerInfo: [], // 纳税非正常户信息
      individualRevokeInfo: [], // 个体户吊销信息
      individualCancelInfo: [], // 个体户注销信息
      administrativePenaltyInfo: [], //行政处罚信息
      //关联信息
      contributionPermitInfo: [], //乡村建设规划许可证信息
      // 控制各节点展开/折叠状态
      isIdentityOpen: true,
      isPropertyOpen: true,
      isConsumptionOpen: true,
      isActionOpen: true,
      isRelationOpen: true,
      currentCompany: null, // 当前企业的完整数据
      dishonesty: false,
      related_cases: false,
      related_ContributionPermit: false,
      // 数据存在性标记（控制按钮禁用状态）
      hasShareholdersInfo: false,
      hasBusinessInfo: false,
      hasEvaluation: false,
      // 基本信息数据项
      hasIdentityData:{
        'isBaseInfo': false,
        'isMarketInfo': false,
        'isSocialInfo': false,
        'isShareHolderInfo': false,
        'isDirectorInfo': false,
        'isSupervisorInfo': false,
        'isBusinessInfo': false,
        'isLicenseInfo': false,
        'isElectronicCertificateInfo': false,
        'isAdministrativeAwardInfo': false,
        'isEvaluationInfo': false,
        'isSocialSecurityInfo': false,
        'isElectricityInfo': false,
        'isInsuranceUnitInfo': false
      },
      //财产信息数据项
      hasPropertyData: {
        'isOtherPropertyInfo': false,
        'isBankCardInfo': false,
        'isHousePropertyInfo': false,
        'isVehicleInfo': false,
        'isShipInfo': false,
        'isPublicPatentInfo': false,
        'isTrademarkInfo': false,
        'isPlanningPermissionInfo': false,
        'isAdministrativePermissionInfo': false,
        'isAnnualReportInfo': false
      },
      hasTaxData: {
        'isIndividualBussinessInfo': false,
        'isEnterpriseIncomeTaxInfo': false,
        'isTaxPayCreditInfo': false,
        'isTaxArrearsInfo': false,
        'isAuthorizedTaxInfo': false,
        'isAbnormalTaxPayerInfo': false,
      },
      //关联信息
      hasRelationData: {
        'related-enterprises': false,
        'related-cases': false,
        'isContributionPermitInfo': false
      },

      //接口、库表状态
      //基本信息接口状态
      hasIdentityDataError:{
        'isBaseError': false,
        'isMarketError': false,
        'isSocialError': false,
        'isShareHolderError': false,
        'isDirectorError': false,
        'isSupervisorError': false,
        'isBusinessError': false,
        'isLicenseError': false,
        'isElectronicCertificateError': false,
        'isAdministrativeAwardError': false,
        'isEvaluationError': false,
        'isSocialSecurityError': false,
        'isElectricityError': false,
        'isInsuranceUnitError': false
      },
      // 财产信息接口状态
      hasPropertyDataError:{
        'isOtherPropertyError': false,
        'isBankCardError': false,
        'isHousePropertyError': false,
        'isVehicleError': false,
        'isShipError': false,
        'isPublicPatentError': false,
        'isTrademarkError': false,
        'isPlanningPermissionError': false,
        'isAdministrativePermissionError': false,
        'isAnnualReportError': false
      },
      // 税务接口状态
      hasTaxDataError: {
        'isIndividualBussinessError': false,
        'isEnterpriseIncomeTaxError': false,
        'isTaxPayCreditError': false,
        'isTaxArrearsError': false,
        'isAuthorizedTaxError': false,
        'isAbnormalTaxPayerError': false,
      },
      // 关联接口状态
      hasRelationDataError: {
        'related-enterprises': false,
        'related-cases': false,
        'isContributionPermitError': false
      },
      // 弹窗相关
      dialogVisible: false,
      dialogTitle: "",
      dialogTableData: [],
      dialogType: "", // 弹窗类型：shareholder/business/bank-card等
      dialogEmptyText: "暂无相关数据",
      dialogTextContent: ""
    };
  },
  computed: {
    companyInfo() {
      return {
        idNumber: this.idNumber,
        name: this.name,
        isQuery: this.isQuery
      }
    },
    // 基本信息分支（股东+工商）
    identityLeftUp() {
      const identityLeftUpData = [];
      // 市场主体基本信息
      if (this.hasIdentityData['isMarketInfo'] ){
        identityLeftUpData.push({
          id: 'market',
          title: '市场主体基本信息',
          content: `共 ${this.marketInfo.length} 条记录。`
        });
      }else if (this.hasIdentityDataError['isMarketError']) {
        identityLeftUpData.push({
          id: 'market',
          title: '市场主体基本信息',
          content: `可查看`
        })
      }else {
        identityLeftUpData.push({
          id: 'market',
          title: '市场主体基本信息',
          disabled: true,
        })
      }
      // 社会组织信息
      if (this.hasIdentityData['isSocialInfo']){
        identityLeftUpData.push({
          id: 'social',
          title: '社会组织信息',
          content: `共 ${this.socialInfo.length} 条记录。`
        });
      }else if (this.hasIdentityDataError['isSocialError']) {
        identityLeftUpData.push({
          id: 'social',
          title: '社会组织信息',
          content: `可查看`
        })
      }else {
        identityLeftUpData.push({
          id: 'social',
          title: '社会组织信息',
          disabled: true,
        })
      }
      // 股东信息
      if(this.hasIdentityData['isShareHolderInfo']){
        identityLeftUpData.push({
          id: 'shareholder',
          title: '股东信息',
          content: `共 ${this.shareHolderInfo.length} 条记录。`
        });
      }else if(this.hasIdentityDataError['isShareHolderError']){
        identityLeftUpData.push({
          id: 'shareholder',
          title: '股东信息',
          content: `可查看`
        });
      } else {
        identityLeftUpData.push({
          id: 'shareholder',
          title: '股东信息',
          disabled: true,
        });
      }
      // 董事信息
      if (this.hasIdentityData['isDirectorInfo']){
        identityLeftUpData.push({
          id: 'director',
          title: '董事信息',
          content: `共 ${this.directorInfo.length} 条记录。`
        });
      }else if (this.hasIdentityDataError['isDirectorError']){
        identityLeftUpData.push({
          id: 'director',
          title: '董事信息',
          content: `可查看`
        })
      }else {
        identityLeftUpData.push({
          id: 'director',
          title: '董事信息',
          disabled: true,
        })
      }
      // 监事信息
      if (this.hasIdentityData['isSupervisorInfo']){
        identityLeftUpData.push({
          id: 'supervisor',
          title: '监事信息',
          content: `共 ${this.supervisorInfo.length} 条记录。`
        });
      }else if (this.hasIdentityDataError['isSupervisorError']){
        identityLeftUpData.push({
          id: 'supervisor',
          title: '监事信息',
          content: `可查看`
        })
      }else {
        identityLeftUpData.push({
          id: 'supervisor',
          title: '监事信息',
          disabled: true,
        })
      }
      return identityLeftUpData;
    },

    identityLeft() {
      const identityLeftData = [
      ];
      // 企业基本信息
      if (this.hasIdentityData['isBaseInfo'] ){
        identityLeftData.push({
          id: 'base',
          title: '企业基本信息',
          content: `共 ${this.BaseInfo.length} 条记录。`
        });
      }else if (this.hasIdentityDataError['isBaseError']) {
        identityLeftData.push({
          id: 'base',
          title: '企业基本信息',
          content: `可查看`
        })
      }else {
        identityLeftData.push({
          id: 'base',
          title: '企业基本信息',
          disabled: true,
        })
      }
      // 工商信息
      if(this.hasIdentityData['isBusinessInfo']){
        identityLeftData.push({
          id: 'business',
          title: '工商信息',
          content: `共 ${this.businessInfo.length} 条记录。`
        });
      }else if (this.hasIdentityDataError['isBusinessError']){
        identityLeftData.push({
          id: 'business',
          title: '工商信息',
          content: `可查看`,
        })
      }else {
        identityLeftData.push({
          id: 'business',
          title: '工商信息',
          disabled: true,
        })
      }
      // 营业执照信息
      if(this.hasIdentityData['isLicenseInfo']){
        identityLeftData.push({
          id: 'license',
          title: '营业执照信息',
          content: `共 ${this.licenseInfo.length} 条记录。`
        });
      }else if (this.hasIdentityDataError['isLicenseError']){
        identityLeftData.push({
          id: 'license',
          title: '营业执照信息',
          content: `可查看`,
        })
      }else {
        identityLeftData.push({
          id: 'license',
          title: '营业执照信息',
          disabled: true,
        })
      }
      // 电子证照信息
      if(this.hasIdentityData['isElectronicCertificateInfo']){
        identityLeftData.push({
          id: 'electronicCertificate',
          title: '电子证照信息',
          content: `共 ${this.electronicCertificateInfo.length} 条记录。`
        });
      }else if (this.hasIdentityDataError['isElectronicCertificateError']){
        identityLeftData.push({
          id: 'electronicCertificate',
          title: '电子证照信息',
          content: `可查看`,
        })
      }else {
        identityLeftData.push({
          id: 'electronicCertificate',
          title: '电子证照信息',
          disabled: true,
        })
      }
      // 行政奖励
      if(this.hasIdentityData['isAdministrativeAwardInfo']){
        identityLeftData.push({
          id: 'administrativeAward',
          title: '行政奖励',
          content: `共 ${this.administrativeAwardInfo.length} 条记录。`
        });
      }else if (this.hasIdentityDataError['isAdministrativeAwardError']){
        identityLeftData.push({
          id: 'administrativeAward',
          title: '行政奖励',
          content: `可查看`,
        })
      }else {
        identityLeftData.push({
          id: 'administrativeAward',
          title: '行政奖励',
          disabled: true,
        })
      }
      // 行政评定
      if(this.hasIdentityData['isEvaluationInfo']){
        identityLeftData.push({
          id: 'evaluation',
          title: '行政评定',
          content: `共 ${this.EvaluationInfo.length} 条记录。`
        });
      }else if (this.hasIdentityDataError['isEvaluationError']){
        identityLeftData.push({
          id: 'evaluation',
          title: '行政评定',
          content: `可查看`,
        })
      }else {
        identityLeftData.push({
          id: 'evaluation',
          title: '行政评定',
          disabled: true,
        })
      }
      // 社保信息
      if(this.hasIdentityData['isSocialSecurityInfo']){
        identityLeftData.push({
          id: 'socialSecurity',
          title: '社保信息',
          content: `共 ${this.socialSecurityInfo.length} 条记录。`,
        })
      }else if (this.hasIdentityDataError['isSocialSecurityError']){
        identityLeftData.push({
          id: 'socialSecurity',
          title: '社保信息',
          content: `可查看`,
        })
      }else {
        identityLeftData.push({
          id: 'socialSecurity',
          title: '社保信息',
          disabled: true,
        })
      }
      // 用电信息
      if(this.hasIdentityData['isElectricityInfo']){
        identityLeftData.push({
          id: 'electricity',
          title: '用电信息',
          content: `共 ${this.electricityInfo.length} 条记录。`,
        })
      }else if(this.hasIdentityDataError['isElectricityError']){
        identityLeftData.push({
          id: 'electricity',
          title: '用电信息',
          content: `可查看`,
        })
      }else {
        identityLeftData.push({
          id: 'electricity',
          title: '用电信息',
          disabled: true,
        })
      }
      // 参保单位基本信息
      if (this.hasIdentityData['isInsuranceUnitInfo']){
        identityLeftData.push({
          id: 'insuranceUnit',
          title: '参保单位基本信息',
          content: `共 ${this.insuranceUnitInfo.length} 条记录。`,
        })
      }else if (this.hasIdentityDataError['isInsuranceUnitError']){
        identityLeftData.push({
          id: 'insuranceUnit',
          title: '参保单位基本信息',
          content: `可查看`,
        })
      }else {
        identityLeftData.push({
          id: 'insuranceUnit',
          title: '参保单位基本信息',
          disabled: true,
        })
      }
      return identityLeftData;
    },

    // 财产信息分支（其他财产+银行卡+房产+车辆）
    propertyRightUp() {
      const propertyRightUpInfo = [];
      // 公开专利信息
      if (this.hasPropertyData['isPublicPatentInfo']){
        propertyRightUpInfo.push({
          id: 'publicPatent',
          title: '公开专利信息',
          content: `共 ${this.publicPatentInfo.length} 条记录。`
        });
      }else if (this.hasPropertyDataError['isPublicPatentError']){
        propertyRightUpInfo.push({
          id: 'publicPatent',
          title: '公开专利信息',
          content: `可查看`,
        });
      }else {
        propertyRightUpInfo.push({
          id: 'publicPatent',
          title: '公开专利信息',
          disabled: true
        });
      }
      // 商标信息
      if (this.hasPropertyData['isTrademarkInfo']){
        propertyRightUpInfo.push({
          id: 'trademark',
          title: '商标信息',
          content: `共 ${this.trademarkInfo.length} 条记录。`
        });
      }else if (this.hasPropertyDataError['isTrademarkError']){
        propertyRightUpInfo.push({
          id: 'trademark',
          title: '商标信息',
          content: `可查看`,
        });
      }else {
        propertyRightUpInfo.push({
          id: 'trademark',
          title: '商标信息',
          disabled: true
        });
      }
      // 规划许可
      if (this.hasPropertyData['isPlanningPermissionInfo']){
        propertyRightUpInfo.push({
          id: 'planningPermission',
          title: '规划许可',
          content: `共 ${this.planningPermissionInfo.length} 条记录。`
        });
      }else if (this.hasPropertyDataError['isPlanningPermissionError']){
        propertyRightUpInfo.push({
          id: 'planningPermission',
          title: '规划许可',
          content: `可查看`,
        });
      }else {
        propertyRightUpInfo.push({
          id: 'planningPermission',
          title: '规划许可',
          disabled: true
        });
      }
      // 行政许可
      if (this.hasPropertyData['isAdministrativePermissionInfo']){
        propertyRightUpInfo.push({
          id: 'administrativePermission',
          title: '行政许可',
          content: `共 ${this.administrativePermissionInfo.length} 条记录。`
        });
      }else if (this.hasPropertyDataError['isAdministrativePermissionError']){
        propertyRightUpInfo.push({
          id: 'administrativePermission',
          title: '行政许可',
          content: `可查看`,
        });
      }else {
        propertyRightUpInfo.push({
          id: 'administrativePermission',
          title: '行政许可',
          disabled: true
        });
      }
      return propertyRightUpInfo;
    },

    propertyRightDown() {
      const propertyRightDownInfo = [];
      // 年报信息
      if (this.hasPropertyData['isAnnualReportInfo']){
        propertyRightDownInfo.push({
          id: 'annualReport',
          title: '年报信息',
          content: `共 ${this.annualReportInfo.length} 条记录。`
        });
      }else if (this.hasPropertyDataError['isAnnualReportError']){
        propertyRightDownInfo.push({
          id: 'annualReport',
          title: '年报信息',
          content: `可查看`,
        });
      }else {
        propertyRightDownInfo.push({
          id: 'annualReport',
          title: '年报信息',
          disabled: true
        });
      }
      // 银行卡信息
      if (this.hasPropertyData['isBankCardInfo']){
        propertyRightDownInfo.push({
          id: 'bankCard',
          title: '银行卡信息',
          content: `共 ${this.bankCardInfo.length} 条记录。`
        });
      }else if (this.hasPropertyDataError['isBankCardError']){
        propertyRightDownInfo.push({
          id: 'bankCard',
          title: '银行卡信息',
          content: `可查看`,
        });
      }else {
        propertyRightDownInfo.push({
          id: 'bankCard',
          title: '银行卡信息',
          disabled: true
        });
      }
      // 房产信息
      if (this.hasPropertyData['isHousePropertyInfo']){
        propertyRightDownInfo.push({
          id: 'houseProperty',
          title: '房产信息',
          content: `共 ${this.housePropertyInfo.length} 条记录。`
        });
      }else if (this.hasPropertyDataError['isHousePropertyError']){
        propertyRightDownInfo.push({
          id: 'houseProperty',
          title: '房产信息',
          content: `可查看`,
        });
      }else {
        propertyRightDownInfo.push({
          id: 'houseProperty',
          title: '房产信息',
          disabled: true
        });
      }
      // 车辆信息
      if (this.hasPropertyData['isVehicleInfo']){
        propertyRightDownInfo.push({
          id: 'vehicle',
          title: '车辆信息',
          content: `共 ${this.vehicleInfo.length} 条记录。`
        });
      }else if (this.hasPropertyDataError['isVehicleError']){
        propertyRightDownInfo.push({
          id: 'vehicle',
          title: '车辆信息',
          content: `可查看`,
        })
      }else {
        propertyRightDownInfo.push({
          id: 'vehicle',
          title: '车辆信息',
          disabled: true
        })
      }
      // 船舶信息
      if (this.hasPropertyData['isShipInfo']){
        propertyRightDownInfo.push({
          id: 'ship',
          title: '船舶信息',
          content: `共 ${this.shipInfo.length} 条记录。`
        });
      }else if (this.hasPropertyDataError['isShipError']){
        propertyRightDownInfo.push({
          id: 'ship',
          title: '船舶信息',
          content: `可查看`,
        })
      }else {
        propertyRightDownInfo.push({
          id: 'ship',
          title: '船舶信息',
          disabled: true
        })
      }

      // 其他财产
      if (this.hasPropertyData['other-property']){
        propertyRightDownInfo.push({
          id: 'other-property',
          title: '其他财产',
          content: `共 ${this.otherPropertyInfo.length} 条记录。`
        });
      }else {
        propertyRightDownInfo.push({
          id: 'other-property',
          title: '其他财产',
          disabled: true
        })
      }
      return propertyRightDownInfo;
    },


    consumptionLeftUp() {
      return [
        { id: 'zhaiwu', title: '债务信息',disabled: true },
        { id: 'guquanbiangen', title: '股权变更信息', disabled: true },
        { id: 'qiyebiangeng', title: '企业变更信息', disabled: true },
        { id: 'qiyezhuxiao', title: '企业注销信息', disabled: true },
        { id: 'qiyediaoxiao', title: '企业吊销信息', disabled: true }
      ];
    },
    // 税务信息分支（纳税信息+纳税资质）
    consumptionLeft() {
      const consumptionLeftData = [];
      // 企业所得税征收方式核定结果
      if (this.hasTaxData['isEnterpriseIncomeTaxInfo']){
        consumptionLeftData.push({
          id: 'enterpriseIncomeTax',
          title: '企业所得税征收方式核定结果',
          content: `共 ${this.enterpriseIncomeTaxInfo.length} 条记录。`
        });
      }else if (this.hasTaxDataError['isEnterpriseIncomeTaxError']){
        consumptionLeftData.push({
          id: 'enterpriseIncomeTax',
          title: '企业所得税征收方式核定结果',
          content: `可查看`,
        });
      }else {
        consumptionLeftData.push({
          id: 'enterpriseIncomeTax',
          title: '企业所得税征收方式核定结果',
          disabled: true
        });
      }
      // 个人工商户定额信息
      if (this.hasTaxData['isIndividualBussinessInfo']){
        consumptionLeftData.push({
          id: 'individualBussiness',
          title: '个人工商户定额信息',
          content: `共 ${this.individualBussinessInfo.length} 条记录。`
        });
      }else if (this.hasTaxDataError['isIndividualBussinessError']){
        console.log("==========",this.hasTaxDataError['isIndividualBussinessError'])
        consumptionLeftData.push({
          id: 'individualBussiness',
          title: '个人工商户定额信息',
          content: `可查看`,
        });
      }else {
        consumptionLeftData.push({
          id: 'individualBussiness',
          title: '个人工商户定额信息',
          disabled: true,
        });
      }
      //纳税信用信息
      if (this.hasTaxData['isTaxPayCreditInfo']){
        consumptionLeftData.push({
          id: 'taxPayCredit',
          title: '纳税信用信息',
          content: `共 ${this.taxPayCreditInfo.length} 条记录。`
        });
      }else if (this.hasTaxDataError['isTaxPayCreditError']){
        consumptionLeftData.push({
          id: 'taxPayCredit',
          title: '纳税信用信息',
          content: `可查看`,
        });
      }else {
        consumptionLeftData.push({
          id: 'taxPayCredit',
          title: '纳税信用信息',
          disabled: true
        });
      }
      // 欠税公告信息
      if (this.hasTaxData['isTaxArrearsInfo']){
        consumptionLeftData.push({
          id: 'taxArrears',
          title: '欠税公告信息',
          content: `共 ${this.taxArrearsInfo.length} 条记录。`
        });
      }else if (this.hasTaxDataError['isTaxArrearsError']){
        consumptionLeftData.push({
          id: 'taxArrears',
          title: '欠税公告信息',
          content: `可查看`,
        });
      }else {
        consumptionLeftData.push({
          id: 'taxArrears',
          title: '欠税公告信息',
          disabled: true
        });
      }
      // 委托代征纳税人信息
      if (this.hasTaxData['isAuthorizedTaxInfo']){
        consumptionLeftData.push({
          id: 'authorizedTax',
          title: '委托代征纳税人信息',
          content: `共 ${this.authorizedTaxInfo.length} 条记录。`
        });
      }else if (this.hasTaxDataError['isAuthorizedTaxError']){
        consumptionLeftData.push({
          id: 'authorizedTax',
          title: '委托代征纳税人信息',
          content: `可查看`,
        });
      }else {
        consumptionLeftData.push({
          id: 'authorizedTax',
          title: '委托代征纳税人信息',
          disabled: true
        });
      }
      // 纳税非正常户信息
      if (this.hasTaxData['isAbnormalTaxPayerInfo']){
        consumptionLeftData.push({
          id: 'abnormalTaxPayer',
          title: '纳税非正常户信息',
          content: `共 ${this.abnormalTaxPayerInfo.length} 条记录。`
        });
      }else if (this.hasTaxDataError['isAbnormalTaxPayerError']){
        consumptionLeftData.push({
          id: 'abnormalTaxPayer',
          title: '纳税非正常户信息',
          content: `可查看`,
        });
      }else {
        consumptionLeftData.push({
          id: 'abnormalTaxPayer',
          title: '纳税非正常户信息',
          disabled: true
        });
      }
      // 个体户吊销信息
      if (this.individualRevokeInfo.length > 0){
        consumptionLeftData.push({
          id: 'getihudiaoxiao',
          title: '个体户吊销信息',
          content: `共 ${this.individualRevokeInfo.length} 条记录。`
        });
      }else {
        consumptionLeftData.push({
          id: 'getihudiaoxiao',
          title: '个体户吊销信息',
          disabled: true
        })
      }
      // 个体户注销信息
      if (this.individualCancelInfo.length > 0){
        consumptionLeftData.push({
          id: 'getihuzhuxiao',
          title: '个体户注销信息',
          content: `共 ${this.individualCancelInfo.length} 条记录。`
        });
      }else {
        consumptionLeftData.push({
          id: 'getihuzhuxiao',
          title: '个体户注销信息',
          disabled: true
        })
      }
      // 行政处罚
      if (this.administrativePenaltyInfo.length > 0){
        consumptionLeftData.push({
          id: 'xingzhengchufa',
          title: '行政处罚',
          content: `共 ${this.administrativePenaltyInfo.length} 条记录。`
        });
      }else {
        consumptionLeftData.push({
          id: 'xingzhengchufa',
          title: '行政处罚',
          disabled: true
        })
      }

      return consumptionLeftData;
      // return [
      //   { id: 'enterpriseIncomeTax', title: '企业所得税征收方式核定结果' },
      //   { id: 'individualBussiness', title: '个人工商户定额信息'},
      //   { id: 'taxPayCredit', title: '纳税信用信息'},
      //   { id: 'taxArrears', title: '欠税公告信息' },
      //   { id: 'authorizedTax', title: '委托代征纳税人信息' },
      //   { id: 'abnormalTaxPayer', title: '纳税非正常户信息' },
      //   { id: 'getihudiaoxiao', title: '个体户吊销信息' },
      //   { id: 'getihuzhuxiao', title: '个体户注销信息' },
      //   { id: 'xingzhengchufa', title: '行政处罚' },
      // ];
    },

    // 信用信息分支（执转破+失信信息+关联案件）
    actionRight() {
      const actionRightData = [];
      // 执转破：根据企业名称判断
      const hasQing = this.currentCompany?.name?.includes('青之峰');
      actionRightData.push({
        id: 'execution',
        title: '执转破',
        content: hasQing ? '推荐进行执转破' : '暂无'
      });

      // 失信信息：根据企业是否有经营异常判断
      const hasAbnormal = this.currentCompany?.Ab_business?.length > 0;
      this.dishonesty = hasAbnormal;
      actionRightData.push({
        id: 'dishonesty',
        title: '失信信息',
        content: hasAbnormal ? '存在经营异常' : '暂无'
      });

      // 关联案件：根据企业是否有执行/审判案件判断
      const hasCases = (this.currentCompany?.executionCases?.length > 0) || (this.currentCompany?.trialCases?.length > 0);
      this.related_cases = hasCases;
      actionRightData.push({
        id: 'related-cases',
        title: '关联案件',
        content: hasCases ? '存在关联案件' : '暂无'
      });

      return actionRightData;
    },

    // 关联信息分支（关联企业+关联财产）
    relationLeft() {

      const relationLeftData = [
        { id: 'related-enterprises', title: '关联企业', disabled: true },
        { id: 'related-cases', title: '关联财产', disabled: true },
        { id: 'guquanchuantou', title: '股权穿透', disabled: true },
      ];

      // 乡村建设许可证
      if (this.hasRelationData['isContributionPermitInfo']){
        relationLeftData.push({
          id: 'contributionPermit',
          title: '乡村建设规划许可证',
          content: `共 ${this.contributionPermitInfo.length} 条记录。`
        });
      }else if (this.hasRelationDataError['isContributionPermitError']){
        relationLeftData.push({
          id: 'contributionPermit',
          title: '乡村建设规划许可证',
          content: '可查看',
        });
      }else {
        relationLeftData.push({
          id: 'contributionPermit',
          title: '乡村建设规划许可证',
          disabled: true
        });
      }
      return relationLeftData;
    }
  },
  methods: {
    // 切换节点展开/折叠状态
    toggleIdentity() {
      this.isIdentityOpen = !this.isIdentityOpen;
      this.adjustLayout();
    },
    toggleProperty() {
      this.isPropertyOpen = !this.isPropertyOpen;
      this.adjustLayout();
    },
    toggleConsumption() {
      this.isConsumptionOpen = !this.isConsumptionOpen;
      this.adjustLayout();
    },
    toggleAction() {
      this.isActionOpen = !this.isActionOpen;
      this.adjustLayout();
    },
    toggleRelation() {
      this.isRelationOpen = !this.isRelationOpen;
      this.adjustLayout();
    },

    // 调整布局（确保内容可见）
    adjustLayout() {
      this.$nextTick(() => {
        const fishbone = this.$el.querySelector('.fishbone');
        const container = this.$el.querySelector('.fishbone-wrapper');
        const contentWrapper = this.$el.querySelector('.content-wrapper');

        if (fishbone && container && contentWrapper) {
          // 计算上下分支最大高度
          const expandUpNodes = this.$el.querySelectorAll('.expand-up .branches:visible');
          const expandDownNodes = this.$el.querySelectorAll('.expand-down .branches:visible');

          let maxUpHeight = 0;
          expandUpNodes.forEach(node => maxUpHeight = Math.max(maxUpHeight, node.offsetHeight));

          let maxDownHeight = 0;
          expandDownNodes.forEach(node => maxDownHeight = Math.max(maxDownHeight, node.offsetHeight));

          // 计算总高度（主节点高度110px + 边距100px）
          const requiredHeight = maxUpHeight + maxDownHeight + 110 + 100;
          const finalHeight = Math.max(requiredHeight, 600);

          container.style.minHeight = `${finalHeight}px`;
          contentWrapper.style.minHeight = `${finalHeight}px`;
          fishbone.style.transform = 'scale(1)';
        }
      });
    },

    // 初始化企业数据（检查各字段存在性）
    initCompanyData() {
      // 优先使用父组件传递的name，无则用默认企业名
      const targetCompanyName = this.name || "连云港市青之峰网络技术有限公司";
      // 通过getCompanyData方法获取当前企业完整数据
      this.currentCompany = getCompanyData({ name: targetCompanyName }) || {};

      // 1. 检查股东信息（shareholders_info字段）
      this.hasShareholdersInfo = !!this.currentCompany.shareholders_info?.length;

      // 2. 检查工商信息（Business_registration_info字段）
      this.hasBusinessInfo = !!this.currentCompany.Business_registration_info?.length;

      // 3. 检查财产信息（银行卡、车辆等）
      this.hasPropertyData['isBankCardInfo'] = !!this.currentCompany.BankCard_info?.length;
      // this.hasPropertyData['isVehicleInfo'] = !!this.currentCompany.Car_info?.length;
      this.hasPropertyData['isHousePropertyInfo'] = !!this.currentCompany.realEstateInfo?.length;
      this.hasPropertyData['other-property'] = !!this.currentCompany.otherProperty_info?.length;
      this.hasPropertyData['isPublicPatentInfo'] = !!this.currentCompany.knowledge?.length;
      this.hasPropertyData['isTrademarkInfo'] = !!this.currentCompany.trademark_info?.length;
      this.hasPropertyData['isPlanningPermissionInfo'] = !!this.currentCompany.plan_permit_info?.length;
      this.hasPropertyData['isAdministrativePermissionInfo'] = !!this.currentCompany.admin_permit_info?.length;
      // this.hasPropertyData['annualReport'] = !!this.currentCompany.annual_report_info?.length;

      // 4. 检查税务信息（纳税金额、纳税资质）
      // this.hasTaxData['enterpriseIncomeTax'] = !!this.currentCompany.contributionDimension?.taxPaid;
      // 纳税资质默认有（若无数据可改为false）
      // this.hasTaxData['tax-qualification'] = true;

      // 5. 检查关联信息（关联企业、关联案件）
      this.hasRelationData['related-enterprises'] = !!this.currentCompany.Ab_business?.length;
      this.hasRelationData['related-cases'] = !!this.currentCompany.executionCases?.length;
    },

    async loadData(){
      console.log(
          "企业名：", this.name,
          "企业统一信用代码:", this.idNumber,
      );
      // 1. 股东信息
      await axios.post(
          "/api/shareHolderInfo/findByName",
          {name:this.name}
      ).then(res => {
        console.log("股东信息返回",res);
        this.hasIdentityData['isShareHolderInfo'] = true;
        if (res.data.code === 200){
          const ShareHolderdata = res.data.data;
          if(ShareHolderdata.length > 0){
            this.hasShareholdersInfo = true;
            this.shareHolderInfo = ShareHolderdata;
            console.log("获得的股东信息：",this.shareHolderInfo)
          }else {
            this.shareHolderInfo = [];
            console.log("获得的股东信息为空")
          }
        }else {
          this.hasIdentityDataError['isShareHolderError'] = true;
          this.shareHolderInfo = [];
        }
      }).catch( e=> {
        console.error("股东信息加载失败:", e);
        this.hasIdentityDataError['isShareHolderError'] = true;
        this.shareHolderInfo = [];
      })
      // 2. 年报信息
      await axios.post(
          "/api/annualReport/findByName",
          {name:this.name}
      ).then(res => {
        console.log("年报信息返回:", res);
        this.hasPropertyData['isAnnualReportInfo'] = true;
        if (res.data.code === 200){
          const annualReportData = res.data.data;
          if(annualReportData.length > 0){
            console.log("获得的年报信息：",annualReportData);
            // 得到年份信息
            const processData = annualReportData.map(item => {
              let year = null;
              if(item.anchedate){
                const date = new Date(item.anchedate);
                if (!isNaN(date.getTime())) {
                  year = date.getFullYear(); // 获取年份（如2014）
                }
              }
              return {
                ...item,
                year : year
              }
            });
            this.annualReportInfo = processData;
            console.log("获得的年报信息（含年份）：",this.annualReportInfo);
          }else {
            this.annualReportInfo = [];
            console.log("获得的年报信息（含年份）为空");
          }
        }else {
          this.hasPropertyDataError['isAnnualReportError'] = true;
          this.annualReportInfo = [];
        }
      }).catch(e => {
        console.error("年报信息加载失败:", e);
        this.hasPropertyDataError['isAnnualReportError'] = true;
        this.annualReportInfo = [];
      });
      // 3. 纳税信用信息
      await axios.post(
          "/api/taxpayerCreditRating/findByName",
          {name:this.name}
      ).then( res => {
        console.log("纳税信用信息返回：", res)
        if (res.data.code === 200){
          const taxpayerCreditData = res.data.data;
          this.hasTaxData["isTaxPayCreditInfo"] = true;
          if (taxpayerCreditData.length > 0){
            this.hasTaxData["isTaxPayCreditInfo"] = true;
            this.taxPayCreditInfo = taxpayerCreditData;
            console.log("获得纳税信用信息：", this.taxPayCreditInfo)
          }else {
            this.taxPayCreditInfo = [];
            console.log("获得纳税信用信息为空：")
          }
        }else {
          this.taxPayCreditInfo = [];
          this.hasTaxDataError['isTaxPayCreditError'] = true;
        }
      }).catch(e => {
        console.error("获得纳税信用信息:", e);
        this.hasTaxDataError['isTaxPayCreditError'] = true;
        this.taxPayCreditInfo = [];
      })
      // 4. 企业所得税征收方式核定结果
      await axios.post(
          "/api/corporateIncomeTaxVerification/findByName",
          {name:this.name}
      ).then( res => {
        console.log("企业所得税征收方式核定结果返回：", res);
        if (res.data.code === 200){
          const enterpriseIncomeTaxData = res.data.data;
          this.hasTaxData['isEnterpriseIncomeTaxInfo'] = true;
          if (enterpriseIncomeTaxData.length > 0){
            this.enterpriseIncomeTaxInfo = enterpriseIncomeTaxData;
            this.hasTaxData['isEnterpriseIncomeTaxInfo'] = true;
            console.log("获取的企业所得税征收方式核定信息：", this.enterpriseIncomeTaxInfo);
          }else {
            this.enterpriseIncomeTaxInfo = [];
            // this.hasTaxData['enterpriseIncomeTax'] = false;
            console.log("企业所得税征收方式核定信息为空")
          }
        }else {
          this.enterpriseIncomeTaxInfo = [];
          this.hasTaxDataError['isEnterpriseIncomeTaxError'] = true;
        }
      }).catch( e => {
        console.error("企业所得税征收方式核定信息:", e);
        this.hasTaxDataError['isEnterpriseIncomeTaxError'] = true;
        this.taxPayCreditInfo = [];
      })

      // 5. 个体工商户定期定额信息
      await axios.post(
          "/api/selfEmployedFixedQuota/findByName",
          {name: this.name}
      ).then( res => {
        console.log("个体工商户定期定额信息返回：", res)
        if (res.data.code === 200){
          const individualBussinessData = res.data.data;
          this.hasTaxData['isIndividualBussinessInfo'] = true;
          if (individualBussinessData.length > 0){
            this.individualBussinessInfo = individualBussinessData;
            this.hasTaxData['isIndividualBussinessInfo'] = true;
            console.log("获取的个体工商户定期定额信息：", this.individualBussinessInfo);
          }else {
            this.individualBussinessInfo = [];
            console.log("获取的个体工商户定期定额信息为空");
          }
        }else {
          this.individualBussinessInfo = [];
          this.hasTaxDataError['isIndividualBussinessError'] = true;
        }
      }).catch( e => {
        console.error("个体工商户定期定额信息:", e);
        this.hasTaxDataError['isIndividualBussinessError'] = true;
        this.individualBussinessInfo = [];
      })

      // 6. 欠税公告信息
      await axios.post(
          "/api/taxArrearsAnnouncement/findByName",
          {name:this.name}
      ).then( res => {
        console.log("返回的欠税公告信息：", res)
        if (res.data.code === 200){
          const taxArrearsData = res.data.data;
          this.hasTaxData['isTaxArrearsInfo'] = true;
          if (taxArrearsData.length > 0){
            this.taxArrearsInfo = taxArrearsData;
            this.hasTaxData['isTaxArrearsInfo'] = true;
            console.log("成功获取欠税公告信息：", this.taxArrearsInfo)
          }else {
            this.taxArrearsInfo = [];
            // this.hasTaxData['taxArrears'] = false;
            console.log("欠税公告信息为空")
          }
        }else {
          this.taxArrearsInfo = [];
          this.hasTaxDataError['isTaxArrearsError'] = true;
        }
      }).catch( e => {
        console.error("欠税公告信息:", e);
        this.hasTaxDataError['isTaxArrearsError'] = true;
        this.taxArrearsInfo = [];
      })

      // 7. 委托代征纳税人信息
      await axios.post(
          "/api/entrustedCollectionTaxpayer/findByName",
          {name: this.name}                            //这里应该传入人名（目前没有），不是公司名
      ).then( res => {
        console.log("返回的委托代征纳税人信息：", res)
        if (res.data.code === 200 ){
          this.hasTaxData['isAuthorizedTaxInfo'] = true;
          const authorizedTaxData = res.data.data;
          if (authorizedTaxData.length > 0 ){
            this.authorizedTaxInfo = authorizedTaxData;
            this.hasTaxData['isAuthorizedTaxInfo'] = true;
            console.log("获取的委托代征纳税人信息：", this.authorizedTaxInfo)
          }else {
            this.authorizedTaxInfo = [];
            console.log("获取的委托代征纳税人信息为空");
          }
        }else {
          this.authorizedTaxInfo = [];
          this.hasTaxDataError['isAuthorizedTaxError'] = true;
        }
      }).catch( e => {
        console.error("委托代征纳税人信息:", e);
        this.hasTaxData['authorizedTax'] = false;
        this.hasTaxDataError['isAuthorizedTaxError'] = true;
      })

      // 8.纳税非正常户信息
      await axios.post(
          "/api/taxAbnormalHousehold/findByName",
          {name: this.name}
      ).then( res => {
        console.log("返回纳税非正常户信息：", res);
        if (res.data.code === 200 ){
          const abnormalTaxPayerData = res.data.data;
          this.hasTaxData['isAbnormalTaxPayerInfo'] = true;
          if (abnormalTaxPayerData.length > 0){
            this.abnormalTaxPayerInfo = abnormalTaxPayerData;
            this.hasTaxData['isAbnormalTaxPayerInfo'] = true;
            console.log("获取的纳税非正常户信息：", this.abnormalTaxPayerInfo)
          }else {
            this.abnormalTaxPayerInfo = [];
            // this.hasTaxData['abnormalTaxPayer'] = false;
            console.log("获取的纳税非正常户信息为空")
          }
        }else {
          this.abnormalTaxPayerInfo = [];
          this.hasTaxDataError['isAbnormalTaxPayerError'] = true;
        }
      }).catch( e => {
        console.error("纳税非正常户信息:", e);
        this.hasTaxDataError['isAbnormalTaxPayerError'] = true;
        this.abnormalTaxPayerInfo = [];
      })

      // 9.乡村建设规划许可证信息
      await axios.post(
          "/api/ruralConstructionPermit/findByName",
          {name: this.name}
      ).then( res => {
        console.log("返回乡村建设规划许可证信息：", res);
        if (res.data.code === 200 ){
          const ruralConstructionPermitData = res.data.data;
          this.hasRelationData['isContributionPermitInfo'] = true;
          if (ruralConstructionPermitData.length > 0){
            this.contributionPermitInfo = ruralConstructionPermitData;
            this.hasRelationData['isContributionPermitInfo'] = true;
            console.log("获取的乡村建设规划许可证信息：", this.contributionPermitInfo)
          }else {
            this.contributionPermitInfo = [];
            console.log("获取的乡村建设规划许可证信息为空")
          }
        }else {
          this.hasRelationDataError['isContributionPermitError'] = true;
          this.contributionPermitInfo = [];
        }
      }).catch( e => {
        console.error("乡村建设规划许可证信息:", e);
        this.hasRelationDataError['isContributionPermitError'] = true;
        this.contributionPermitInfo = [];
      })

      // 10.行政评定信息
      await axios.post(
          "/api/mergeEnterprise/findByName",
          {name: this.name}
      ).then( res => {
        console.log("返回行政评定信息：", res);
        if (res.data.code === 200 ){
          const EvaluationData = res.data.data;
          this.hasIdentityData['isEvaluationInfo'] = true;
          if (EvaluationData.length > 0){
            this.EvaluationInfo = EvaluationData;
            this.hasIdentityData['isEvaluationInfo'] = true;
            console.log("行政评定信息：", this.EvaluationInfo)
          }else {
            this.EvaluationInfo = [];
            console.log("行政评定信息为空")
          }
        }else {
          this.EvaluationInfo = [];
          this.hasIdentityDataError['isEvaluationError'] = true;
        }
      }).catch( e => {
        console.error("行政评定信息:", e);
        this.hasIdentityDataError['isEvaluationError'] = true;
        this.EvaluationInfo = [];
      })
      // 11.车辆信息
      await axios.post(
          "/api/external/enterprise/carInformation",
          {name: this.name, code:this.idNumber}
      ).then( res => {
        console.log("返回车辆信息：", res);
        if (res.data.code === 200 ){
          const vehicleData = res.data.data.datas;
          this.hasPropertyData['isVehicleInfo'] = true;
          if (vehicleData.length > 0){
            this.vehicleInfo = vehicleData;
            this.hasPropertyData['isVehicleInfo'] = true;
            console.log("车辆信息：", this.vehicleInfo)
          }else {
            this.vehicleInfo = [];
            console.log("车辆信息为空")
          }
        }else {
          this.hasPropertyDataError['isVehicleError'] = true;
          console.log(this.hasPropertyDataError['isVehicleError'])
          this.vehicleInfo = [];
        }
      }).catch( e => {
        console.error("车辆信息:", e);
        this.hasPropertyDataError['isVehicleError'] = true;
        this.vehicleInfo = [];
      })
      // 12.船舶信息
      await axios.post(
          "/api/external/enterprise/shipInformation",
          {name: this.name}
      ).then( res => {
        console.log("返回船舶信息：", res);
        if (res.data.code === 200 ){
          const shipData = res.data.data.datas;
          this.hasPropertyData['isShipInfo'] = true;
          if (shipData.length > 0){
            this.shipInfo = shipData;
            this.hasPropertyData['isShipInfo'] = true;
            console.log("船舶信息：", this.shipInfo)
          }else {
            this.shipInfo = [];
            console.log("船舶信息为空")
          }
        }else {
          this.hasPropertyDataError['isShipError'] = true;
          this.shipInfo = [];
        }
      }).catch( e => {
        console.error("船舶信息:", e);
        this.hasPropertyDataError['isShipError'] = true;
        this.shipInfo = [];
      })
      // 13.企业基本信息
      await axios.post(
          "/api/external/msa/enterprise/basic_info",
          {name: this.name, code:this.idNumber}
      ).then(res => {
        console.log("企业基本信息返回",res);
        this.hasIdentityData['isBaseInfo'] = true;
        if (res.data.code === 200){
          const Basedata = res.data.data.data;
          if(Basedata.length > 0){
            this.hasIdentityData['isBaseInfo'] = true;
            this.BaseInfo = Basedata;
            console.log("获得的企业基本信息：",this.BaseInfo)
          }else {
            this.BaseInfo = [];
            console.log("获得的企业基本信息为空")
          }
        }else {
          this.hasIdentityDataError['isBaseError'] = true;
          this.BaseInfo = [];
        }
      }).catch( e=> {
        console.error("企业基本信息加载失败:", e);
        this.hasIdentityDataError['isBaseError'] = true;
        this.BaseInfo = [];
      })
      // 14 单位参保基本信息
      await axios.post(
          "/api/insuranceUnitInfo/findByName",
          {name: this.name}
      ).then( res => {
        console.log("返回单位参保基本信息：", res);
        if (res.data.code === 200 ){
          const insuranceUnitData = res.data.data;
          this.hasIdentityData['isInsuranceUnitInfo'] = true;
          if (insuranceUnitData.length > 0){
            this.insuranceUnitInfo = insuranceUnitData;
            this.hasIdentityData['isInsuranceUnitInfo'] = true;
            console.log("获取的单位参保基本信息：", this.insuranceUnitInfo)
          }else {
            this.insuranceUnitInfo = [];
            console.log("获取的单位参保基本信息为空")
          }
        }else {
          this.insuranceUnitInfo = [];
          this.hasIdentityDataError['isInsuranceUnitError'] = true;
        }
      }).catch( e => {
        console.error("单位参保基本信息:", e);
        this.hasIdentityDataError['isInsuranceUnitError'] = true;
        this.insuranceUnitInfo = [];
      })
    },

    // 基本信息分支点击事件（股东/工商）
    handleBasicInfoClick(itemId) {
      switch (itemId) {
        case 'base':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 企业基本信息`;
          if (this.hasIdentityDataError['isBaseError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.BaseInfo;
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'base';
          break;
        case 'shareholder':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 股东信息`;
          if (this.hasIdentityDataError['isShareHolderError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.shareHolderInfo;
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'shareholder';
          break;
        case 'business':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 工商信息`;
          this.dialogTableData = this.currentCompany.Business_registration_info || [];
          this.dialogType = 'business';
          break;
        case 'evaluation':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 行政评定信息`;
          if (this.hasIdentityDataError['isEvaluationError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.EvaluationInfo || [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'evaluation';
          break;
        case 'insuranceUnit':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 单位参保基本信息`;
          if (this.hasIdentityDataError['isInsuranceUnitError']){
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          }else {
            this.dialogTableData = this.insuranceUnitInfo || [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'insuranceUnit';
          break;
      }
      this.dialogVisible = true;
    },

    // 财产信息分支点击事件（银行卡/车辆等）
    showPropertyDialog(itemId) {
      switch (itemId) {
        case 'bankCard':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 银行卡信息`;
          if (this.hasPropertyDataError['isShareHolderError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.currentCompany.BankCard_info || [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'bankCard';
          break;
        case 'vehicle':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 车辆信息`;
          if (this.hasPropertyDataError['isVehicleError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.vehicleInfo || this.currentCompany.Car_info || [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'vehicle';
          break;
        case 'ship':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 船舶信息`;
          if (this.hasPropertyDataError['isShipError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.shipInfo || [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'ship';
          break;
        case 'houseProperty':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 房产信息`;
          if (this.hasPropertyDataError['isHousePropertyError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.currentCompany.realEstateInfo || [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'houseProperty';
          break;
        case 'other-property':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 其他财产`;
          this.dialogTableData = this.currentCompany.otherProperty_info || [];
          this.dialogType = 'other-property';
          break;
        case 'publicPatent':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 公开专利信息`;
          if (this.hasPropertyDataError['isPublicPatentError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            if (this.publicPatentInfo.length > 0){
              this.dialogTableData = this.publicPatentInfo;
            }else if(this.currentCompany.knowledge.length > 0){
              this.dialogTableData = this.currentCompany.knowledge;
            }else {
              this.dialogTableData=[];
            }
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'publicPatent';
          break;
        case 'trademark':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 商标信息`;
          if (this.hasPropertyDataError['isTrademarkError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.trademarkInfo ||  [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'trademark';
          break;
        case 'planningPermission':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 规划许可`;
          if (this.hasPropertyDataError['isPlanningPermissionError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.planningPermissionInfo ||  [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'planningPermission';
          this.dialogTextContent = '暂无规划许可信息';
          break;
        case 'administrativePermission':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 行政许可`;
          if (this.hasPropertyDataError['isPlanningPermissionError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.administrativePermissionInfo ||  [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'administrativePermission';
          this.dialogTextContent = '暂无行政许可信息';
          break;
        case 'annualReport':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 年报信息`;
          if (this.hasPropertyDataError['isAnnualReportError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.annualReportInfo;
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'annualReport';
          break;
      }
      this.dialogVisible = true;
    },

    // 税务信息分支点击事件（纳税信息/纳税资质）
    showTaxDialog(itemId) {
      switch (itemId) {
        //企业所得税征收方式核定结果
        case 'enterpriseIncomeTax':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 企业所得税征收方式核定结果`;
          if (this.hasTaxDataError['isEnterpriseIncomeTaxError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.enterpriseIncomeTaxInfo|| [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'enterpriseIncomeTax';
          break;
        // 个体工商户定期定额信息
        case 'individualBussiness':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 个体工商户定期定额信息`;
          if (this.hasTaxDataError['isIndividualBussinessError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.individualBussinessInfo || [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'individualBussiness';
          break;
        case 'tax-qualification':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 纳税资质`;
          // 示例资质数据（可根据实际字段调整）
          this.dialogTableData = [];
          this.dialogType = 'tax-qualification';
          break;
        // 纳税信用
        case 'taxPayCredit':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 纳税信用`;
          if (this.hasTaxDataError['isTaxPayCreditError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.taxPayCreditInfo || [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'taxPayCredit';
          break;
        // 欠税公告
        case 'taxArrears':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 欠税公告`;
          if (this.hasTaxDataError['isTaxArrearsError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.taxArrearsInfo || [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'taxArrears';
          break;
        // 委托代征纳税人信息
        case 'authorizedTax':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 委托代征纳税人信息`;
          if (this.hasTaxDataError['isAuthorizedTaxError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.authorizedTaxInfo || [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'authorizedTax';
          break;
        case 'abnormalTaxPayer':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 纳税非正常户信息`;
          if (this.hasTaxDataError['isAbnormalTaxPayerError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.abnormalTaxPayerInfo || [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'abnormalTaxPayer';
          break;
      }
      this.dialogVisible = true;
    },

    // 关联信息分支点击事件（关联企业/关联案件）
    showRelationDialog(itemId) {
      switch (itemId) {
        case 'related-enterprises':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 关联企业`;
          this.dialogTableData = this.currentCompany.Ab_business || [];
          this.dialogType = 'related-enterprises';
          break;
        case 'related-cases':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 关联案件`;
          this.dialogTableData = this.currentCompany.executionCases || [];
          this.dialogType = 'related-cases';
          break;
        case 'contributionPermit':
          this.dialogTitle = `${this.currentCompany.name || '当前企业'} - 乡村建设规划许可证信息`;
          if (this.hasRelationDataError['isContributionPermitError']) {
            this.dialogTableData = [];
            this.dialogEmptyText = "请检查网络环境或联系接口管理员";
          } else {
            this.dialogTableData = this.contributionPermitInfo || [];
            this.dialogEmptyText = this.dialogTableData.length === 0 ? "查询数据为空" : "";
          }
          this.dialogType = 'contributionPermit';
          break;
      }
      this.dialogVisible = true;
    },

    // 信用信息分支点击事件（执转破/失信信息/关联案件）
    showDetail(itemId, category) {
      if (category !== 'credit') return;

      const item = this.actionRight.find(i => i.id === itemId);
      if (!item || item.content === '暂无') return;

      switch (itemId) {
        case 'execution':
          this.dialogTitle = '执转破分析';
          this.dialogTextContent = this.currentCompany.suggestion || '暂无执转破建议';
          this.dialogType = 'text';
          break;
        case 'dishonesty':
          this.dialogTitle = '失信信息';
          this.dialogTableData = this.currentCompany.Ab_business || [];
          this.dialogType = 'related-enterprises';
          break;
        case 'related-cases':
          this.dialogTitle = '关联案件';
          this.dialogTableData = this.currentCompany.executionCases || [];
          this.dialogType = 'related-cases';
          break;
      }
      this.dialogVisible = true;
    },

    // 日期格式化（处理data.js中的时间戳）
    formatDate(row, column) {
      const timestamp = row[column.prop];
      if (!timestamp || timestamp < 100000000000) return '暂无'; // 排除非时间戳数值
      const date = new Date(timestamp);
      return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
    }
  },
  mounted() {
    // 监听窗口 resize
    window.addEventListener('resize', this.adjustLayout);
    // 初始化企业数据并调整布局
    // this.initCompanyData();
    // this.$nextTick(() => this.adjustLayout());
  },
  beforeUnmount() {
    window.removeEventListener('resize', this.adjustLayout);
  },
  watch: {
    'companyInfo.isQuery': {
      handler(newVal, oldVal) {
        console.log('watch触发：', 'oldVal=', oldVal, 'newVal=', newVal);
        if (newVal != oldVal) {
          console.log('满足条件，准备执行init和load');
          this.initCompanyData();
          this.loadData(); // 关键：确认是否进入这里
          this.adjustLayout();
        } else {
          console.log('不满足条件，跳过执行');
        }
      }
    }
  }
};
</script>

<style scoped>
/* 鱼骨图容器基础样式 */
.fishbone-wrapper {
  width: 100%;
  min-height: 700px;
  overflow: visible;
  box-sizing: border-box;
  position: relative;
  transition: min-height 0.3s ease;
}

.content-wrapper {
  width: 100%;
  height: auto;
  min-height: 700px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  box-sizing: border-box;
  overflow: visible;
}

.fishbone-container {
  width: 100%;
  height: auto;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding: 20px 0;
  box-sizing: border-box;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.fishbone-container::-webkit-scrollbar {
  display: none;
}

/* 鱼骨图主体样式 */
.fishbone {
  position: relative;
  min-height: 700px;
  height: auto;
  display: flex;
  align-items: center;
  min-width: 1000px;
  box-sizing: border-box;
  transition: transform 0.3s ease;
  padding: 100px 0;
}

/* 鱼头鱼尾样式 */
.fish-head {
  width: 120px;
  height: 160px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 2;
  transition: all 0.3s ease;
  margin-right: -25px;
}

.fish-head:hover {
  transform: scale(1.05);
}

.head-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50% 30% 30% 50%;
}

.fish-tail {
  width: 120px;
  height: 160px;
  position: relative;
  display: flex;
  align-items: center;
  margin-left: -20px;
}

.tail-image {
  width: 80px;
  height: 120px;
  object-fit: contain;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* 主骨和节点样式 */
.main-bone {
  flex-grow: 1;
  position: relative;
  height: 8px;
  margin: 0;
  background: linear-gradient(90deg, #3498db, #2980b9, #1abc9c, #3498db, #2980b9);
  background-size: 400% 100%;
}

.main-node {
  position: absolute;
  width: 120px;
  margin-left: -60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s ease;
  top: 50%;
  transform: translateY(-50%);
}

.node-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  text-align: center;
  z-index: 2;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  padding: 10px;
  font-size: 22px;
  line-height: 1.3;
  background-size: 100% 100%;
}

.node-circle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.node-circle i {
  margin-top: 8px;
  font-size: 14px;
  opacity: 0.8;
}

/* 节点位置与颜色 */
.identity-node { left: 10%; }
.property-node { left: 30%; }
.consumption-node { left: 50%; }
.action-node { left: 70%; }
.relation-node { left: 90%; }

.identity-node .node-circle { background: linear-gradient(135deg, #3498db, #2980b9); }
.property-node .node-circle { background: linear-gradient(135deg, #2980b9, #1abc9c); }
.consumption-node .node-circle { background: linear-gradient(135deg, #1abc9c, #3498db); }
.action-node .node-circle { background: linear-gradient(135deg, #3498db, #2980b9); }
.relation-node .node-circle { background: linear-gradient(135deg, #2980b9, #1abc9c); }

.main-node.active .node-circle {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
}

/* 分支样式 */
.branches {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 20px;
  opacity: 0;
  width: 180px;
  transition: all 0.3s ease;
}

.expand-down .branches {
  top: 130px;
  animation: fadeInDown 0.4s ease forwards;
}

.expand-up .branches {
  bottom: 130px;
  animation: fadeInUp 0.4s ease forwards;
}

.centered {
  left: 50%;
  transform: translateX(-50%);
}

/* 分支项样式 */
.branch-box {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  background-color: white;
  transform: scale(0.95);
  opacity: 0;
  animation: branchFadeIn 0.3s ease forwards;
  cursor: pointer;
}

.branch-box:nth-child(1) { animation-delay: 0.1s; }
.branch-box:nth-child(2) { animation-delay: 0.2s; }
.branch-box:nth-child(3) { animation-delay: 0.3s; }
.branch-box:nth-child(4) { animation-delay: 0.4s; }

.branch-box:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px) scale(1.02);
}

.box-title {
  padding: 8px 12px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  color: #333;
  border-radius: 6px 6px 0 0;
}

/* 禁用状态样式 */
.branch-box.disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.branch-box.disabled .box-title {
  background-color: #eeeeee;
  color: #999;
}

.branch-box.disabled:hover {
  box-shadow: none;
  transform: none;
}

/* 弹窗内容样式 */
.dialog-content {
  background-color: #fff;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.8;
}

.text-content {
  padding: 20px;
  color: #333;
  line-height: 2;
}

/* 动画效果 */
@keyframes fadeInDown {
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeInUp {
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes branchFadeIn {
  to { opacity: 1; transform: scale(1); }
}

/* 响应式调整 */
@media (max-width: 1200px) {
  .branch-box { width: 180px; }
  .branches { width: 180px; }
  .node-circle { width: 100px; height: 100px; font-size: 20px; }
  .main-node { width: 100px; margin-left: -50px; }
  .fish-head { width: 100px; height: 130px; margin-right: -8px; }
  .fish-tail { width: 100px; height: 130px; margin-left: -8px; }
  .tail-image { width: 70px; height: 100px; }
}

@media (max-width: 992px) {
  .branch-box { width: 150px; font-size: 13px; }
  .branches { width: 150px; }
  .identity-node { left: 5%; }
  .relation-node { left: 95%; }
  .fishbone { padding: 180px 0; }
  .fish-head { width: 90px; height: 110px; margin-right: -6px; }
  .node-circle { font-size: 18px; }
}

@media (max-width: 768px) {
  .fishbone { padding: 160px 0; min-width: 800px; }
  .branches { gap: 15px; }
  .fish-head { width: 80px; height: 100px; margin-right: -5px; }
  .fish-tail { width: 80px; height: 100px; margin-left: -5px; }
  .tail-image { width: 60px; height: 80px; }
  .node-circle { font-size: 17px; }
}

@media (max-width: 576px) {
  .fishbone { padding: 150px 0; min-width: 600px; }
  .node-circle { width: 90px; height: 90px; font-size: 16px; }
  .branch-box { width: 130px; }
  .expand-down .branches, .expand-up .branches { top: 130px; bottom: auto; }
  .fish-head { width: 70px; height: 90px; margin-right: -4px; }
  .fish-tail { width: 70px; height: 90px; margin-left: -4px; }
}
</style>